﻿using AiShow.BLL;

using AiShow.Model;
using AiShow.Model.OperResult;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AiShow.WebSite
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        IAccountManager AccountManager = new AccountManager();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
            if (Page.IsValid) {
                TBLogins logins = new TBLogins()
                {
                    Password = txtPassword.Text,
                    MobileNumber = txtMobileNumber.Text,
                    UserName = txtUserName.Text
                };
                IAccountManager AccountManager = new AccountManager();
                OperResult result = AccountManager.Register(logins);
                
                if (result.StatusCode == StatusCode.Succeed)
                {
                    Response.Redirect("Login.aspx");
                }
            }
        }

    }
}